Skip to content

Potential fix for code scanning alert no. 18: Workflow does not contain permissions#36

Merged
cortega26 merged 1 commit intomainfrom
alert-autofix-18
Mar 30, 2026
Merged

Potential fix for code scanning alert no. 18: Workflow does not contain permissions#36
cortega26 merged 1 commit intomainfrom
alert-autofix-18

Conversation

@cortega26
Copy link
Copy Markdown
Owner

Potential fix for https://github.com/cortega26/polla/security/code-scanning/18

To fix the problem, explicitly define a permissions block assigning the least privileges required for this workflow. Since the job only checks out code, caches data, runs Python, and uploads artifacts—none of which require write access to repository contents or other GitHub resources—it can safely use contents: read at the workflow or job level.

The best minimal fix without changing functionality is to add a top-level permissions block so it applies to all jobs in this workflow. In .github/workflows/update.yml, between the name: Alt Sources Dry Run line and the on: block, insert:

permissions:
  contents: read

This documents that the workflow only needs read access to repository contents and constrains GITHUB_TOKEN accordingly. No imports, methods, or additional definitions are needed; this is purely a YAML configuration change in the workflow file.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@cortega26 cortega26 marked this pull request as ready for review March 30, 2026 23:35
@cortega26 cortega26 merged commit a35b89a into main Mar 30, 2026
9 checks passed
@cortega26 cortega26 deleted the alert-autofix-18 branch March 30, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant